/**
 * @filename:SysUploadConfigServiceImpl 2022年1月27日
 * @project Wonder wallet Framework  V1.0
 * Copyright(c) 2018 LuZhongren Co. Ltd. 
 * All right reserved. 
 */
package com.wonder.admin.service.impl;

import com.wonder.admin.domain.SysUploadConfig;
import com.wonder.admin.mapper.SysUploadConfigDao;
import com.wonder.admin.service.SysUploadConfigService;
import com.wonder.admin.request.SysUploadConfigRequest;
import com.wonder.common.utils.StringUtils;

import io.swagger.annotations.ApiModelProperty;

import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;


/**   
 * @Description:TODO(上传参数配置服务实现)
 *
 * @version: V1.0
 * @author: LuZhongren
 * 
 */
@Service
public class SysUploadConfigServiceImpl  extends ServiceImpl<SysUploadConfigDao, SysUploadConfig> implements SysUploadConfigService  {

   /**
     * 修改上传参数配置信息
     * 
     * @param SysUploadConfig信息
     * @return 结果
     */
    @Override
    public int updateEx(SysUploadConfig sysUploadConfig){
       if(sysUploadConfig!=null)
		     return this.baseMapper.updateById(sysUploadConfig);
       return 0;
    }
    
    
    /**
	 * Description:上传参数配置分页返回
	 * @request:检索条件
	 * @page：分页参数
	 * @return:分页记录
	 */
	@Override 
	public IPage<SysUploadConfig> selectList(SysUploadConfigRequest request, Page<SysUploadConfig> page){
	    LambdaQueryWrapper<SysUploadConfig> lambdaQueryWrapper = new LambdaQueryWrapper<>();
	    
        if(request.getThumb_status()!=null) {
			lambdaQueryWrapper.eq(SysUploadConfig::getThumb_status, request.getThumb_status());
		} 
        if (request.getThumb_type()!=null) {
     			lambdaQueryWrapper.eq(SysUploadConfig::getThumb_type, request.getThumb_type());
     		}
        if (request.getUpload_replace()!=null) {
     			lambdaQueryWrapper.eq(SysUploadConfig::getUpload_replace, request.getUpload_replace());
     		}
	      
		lambdaQueryWrapper.orderByDesc(SysUploadConfig::getId);	
		Page<SysUploadConfig> selectPage = this.baseMapper.selectPage(page, lambdaQueryWrapper);

		return selectPage;
    }
    
	
}